import request from "@/utils/request.js";
import utils from "@/utils/utils.js"
export default{
	register(params) {
		return request({
			url: 'register',
			method: 'post',
			data: params,
			header: {
				isToken: false
			}
		})
	},
	
	
	
	sendsms(params) { // 获取短信验证码
		return request({
			url: 'sendsms?mobile=' + params.mobile,
			method: 'post',
			data: params,
			header: {
				isToken: false
			}
		})
	},
	userRegister(params) { // 注册
		return request({
			url: 'register',
			method: 'post',
			data: params,
			header: {
				isToken: false
			}
		})
	},
	getAppUserAgreements(params) { // 查看用户协议
		return request({
			url: 'api/cr-app-user-agreements/getAppUserAgreements',
			method: 'get',
			header: {
				isToken: false
			}
		})
	},
	// api/cr-app-privacy-agreements/getAppPrivacyAgreements查看隐私协议
	getAppPrivacyAgreements(params) { // 查看隐私协议
		return request({
			url: 'api/cr-app-privacy-agreements/getAppPrivacyAgreements',
			method: 'get',
			header: {
				isToken: false
			}
		})
	},
	userLogin(params) { // 登录
		return request({
			url: 'login?',
			method: 'post',
			data: params,
			header: {
				isToken: false
			}
		})
	},
	logout() {
		return request({
			url: 'logout',
			method: 'get',
		})
	},
	updPassWord(params) { // 修改密码
		return request({
			url: 'api/cr-operator-renters/updPassWord?' + utils.jsonToQuery(params),
			method: 'post',
			data: params
		})
	},
	updatePayPwd(params) { // 修改密码
		return request({
			url: 'system/user/profile/updatePayPwd?' + utils.jsonToQuery(params),
			method: 'put',
			data: params
		})
	},
	findPassword(params) { // 找回密码
		return request({
			url: 'findPassword',
			method: 'post',
			data: params,
			header: {
				isToken: false
			}
		})
	},
	outLogin(params) { // 登出
		return request({
			url: 'api/cr-operator-renters/outLogin?' + utils.jsonToQuery(params),
			method: 'post'
		})
	},
	getLoginUser() { // 获取登录用户信息
		return request({
			url: 'getInfo',
			method: 'get'
		})
	},
	getCaptchaImage() { // 获取登录用户信息
		return request({
			url: 'captchaImage',
			method: 'get',
			header: {
				isToken: false
			}
		})
	},
	editUserInfo(params) {
		return request({
			url: 'system/user/profile',
			method: 'put',
			data: params
		})
	},
	// 获取微信openId
	getOpenId(params) {
		return request({
			url: 'system/user/getOpenId/' + params.code,
			method: 'put'
		})
	},
	getCode(params) {
		return request({
			url: 'captchaMessage/' + params.mobile,
			method: 'get',
			header: {
				isToken: false
			}
		})
	},
	upatePs(params) {
		return request({
			url: 'captchaMessage/upatePs?' + utils.jsonToQuery(params),
			method: 'put',
			data: params,
			header: {
				isToken: false
			}
		})
	}
}